package cn.zhage.aimin.satoken;

import cn.dev33.satoken.config.SaTokenConfig;
import cn.zhage.aimin.satoken.admin.AdminStpUtil;
import cn.zhage.aimin.satoken.user.UserStpUtil;

/**
 * @author 武天奇
 * @version 1.0
 */
public class StpUtilConfig {
    public void init(){
        SaTokenConfig adminConfig = new SaTokenConfig();
        adminConfig.setTokenName("aimin-amin-token");
        adminConfig.setTimeout(1592000);
        adminConfig.setActiveTimeout(-1L);
        adminConfig.setIsConcurrent(false);
        adminConfig.setIsShare(true);
        adminConfig.setIsLog(true);
        adminConfig.setTokenStyle("random-64");
        adminConfig.setIsWriteHeader(false);
        AdminStpUtil.stpLogic.setConfig(adminConfig);




        SaTokenConfig userConfig = new SaTokenConfig();
        userConfig.setTokenName("aimin-user-token");
        userConfig.setTimeout(1592000);
        userConfig.setActiveTimeout(-1L);
        userConfig.setIsConcurrent(false);
        userConfig.setIsShare(true);
        userConfig.setIsLog(true);
        userConfig.setTokenStyle("random-64");
        userConfig.setIsWriteHeader(false);
        UserStpUtil.stpLogic.setConfig(userConfig);

    }
}
